#
# Copyright (C) 2017 Zoltan Siki siki1958 (at) gmail (dot) com
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.

# transformation from WGS84 to EOV
# Easting (Y) coordinate
# @param x1 longitude
# @param x2 latitude
# @return EOV y coordinate
proc eovy {x1 x2} {
	global E
	set w [expr {672405.6196155909 + 119474.63348558049 * (-49.867628161360976 + 7.672019919382257e-7 / 
		(1 + pow($E, 9.961317079412398 - 3.1488529614666074 * (-47.141879554771464 + $x1) - 
		14.946043984442193 * (-19.35065798136946 + $x2))) - 9.179052741992047e-7 / 
		(1 + pow($E, 5.469006241197208 + 7.654757477436428 * (-47.141879554771464 + $x1) - 
		7.300452765354331 * (-19.35065798136946 + $x2))) - 1.2738590806697233e-6 / 
		(1 + pow($E, -7.679888605388518 - 9.163153839711295 * (-47.141879554771464 + $x1) - 
		6.503352913650384 * (-19.35065798136946 + $x2))) - 0.5193027100751907 / 
		(1 + pow($E, -0.9962137692135526 + 9.37581450786351 * (-47.141879554771464 + $x1) -
		3.2818584352064946 * (-19.35065798136946 + $x2))) + 0.00039075018177461867 / 
		(1 + pow($E, 5.616448722732048 - 3.1874947935892397 * (-47.141879554771464 + $x1) - 
		3.0697001376661 * (-19.35065798136946 + $x2))) - 2.938139646300507 / 
		(1 + pow($E, -1.1243948950085643 + 3.068634126891469 * (-47.141879554771464 + $x1) - 
		1.5575717410480414 * (-19.35065798136946 + $x2))) + 2.9388675779393942 / 
		(1 + pow($E, -1.1243038685354483 + 3.0684940824943605 * (-47.141879554771464 + $x1) - 
		1.557486615594105 * (-19.35065798136946 + $x2))) - 0.0020920873110584237 / 
		(1 + pow($E, -5.966302038656623 - 9.848427956932147 * (-47.141879554771464 + $x1) - 
		0.8791111401218366 * (-19.35065798136946 + $x2))) - 43.44566941927583 / 
		(1 + pow($E, -4.874104040132466 - 1.34109905025172 * (-47.141879554771464 + $x1) - 
		0.7767285300567914 * (-19.35065798136946 + $x2))) + 43.48330467654886 / 
		(1 + pow($E, -4.873840515508285 - 1.3407753461246799 * (-47.141879554771464 + $x1) - 
		0.7766812614487104 * (-19.35065798136946 + $x2))) - 168.39238840854665 / 
		(1 + pow($E, 0.9354333759454302 - 0.041287508927602204 * (-47.141879554771464 + $x1) - 
		0.5135619864745686 * (-19.35065798136946 + $x2))) + 168.45796210270737 / 
		(1 + pow($E, 0.9353909625767644 - 0.04130158517554311 * (-47.141879554771464 + $x1) - 
		0.5135225725329022 * (-19.35065798136946 + $x2))) + 1.9772555599959318 / 
		(1 + pow($E, 4.0484476414553265 + 0.736351759068504 * (-47.141879554771464 + $x1) - 
		0.34639788217611733 * (-19.35065798136946 + $x2))) + 1.295826101459353 / 
		(1 + pow($E, -0.3627566955004641 + 0.5585919654558357 * (-47.141879554771464 + $x1) - 
		0.2173406548700935 * (-19.35065798136946 + $x2))) + 1.4605736989251341 / 
		(1 + pow($E, -2.494652509622057 + 0.5644220884324062 * (-47.141879554771464 + $x1) - 
		0.14760581525023536 * (-19.35065798136946 + $x2))) + 75.53963511558312 / 
		(1 + pow($E, -0.5919291382704243 - 0.017819849574031276 * (-47.141879554771464 + $x1) - 
		0.02876303849328192 * (-19.35065798136946 + $x2))) - 0.513251245503478 / 
		(1 + pow($E, -1.4675221266234437 - 0.7986566791741343 * (-47.141879554771464 + $x1) + 
		0.3493371692554286 * (-19.35065798136946 + $x2))) - 0.13535754779149814 / 
		(1 + pow($E, 1.3790068342398623 + 0.3200348034481885 * (-47.141879554771464 + $x1) + 
		0.3728814841173052 * (-19.35065798136946 + $x2))) - 0.00252379501988373 / 
		(1 + pow($E, 6.0548441688827195 + 9.996119808616546 * (-47.141879554771464 + $x1) + 
		0.8814762010349497 * (-19.35065798136946 + $x2))) + 0.00043537688333485227 / 
		(1 + pow($E, 6.466439411509956 + 10.679569366610007 * (-47.141879554771464 + $x1) + 
		0.8978778194549877 * (-19.35065798136946 + $x2))) + 0.00013194194161862913 / 
		(1 + pow($E, -5.027004969318052 + 1.4142876027298208 * (-47.141879554771464 + $x1) + 
		1.5318202323282735 * (-19.35065798136946 + $x2))) + 2.933275918926217e-6 / 
		(1 + pow($E, 7.802699579558164 - 9.641023437637877 * (-47.141879554771464 + $x1) + 
		1.6795050503860736 * (-19.35065798136946 + $x2))) - 0.00020996999710235208 / 
		(1 + pow($E, -1.9084091394432787 - 3.832758758105277 * (-47.141879554771464 + $x1) + 
		1.6881341364245837 * (-19.35065798136946 + $x2))) + 7.749375170242888e-6 / 
		(1 + pow($E, 7.680453071604488 + 7.234492642134539 * (-47.141879554771464 + $x1) + 
		1.8055690410744814 * (-19.35065798136946 + $x2))) + 0.0004118005640877571 / 
		(1 + pow($E, -5.521307889274655 + 3.111593798926562 * (-47.141879554771464 + $x1) + 
		3.0135166805469797 * (-19.35065798136946 + $x2))) - 0.00002450368752468112 / 
		(1 + pow($E, -1.4324404040418441 - 7.21311230426901 * (-47.141879554771464 + $x1) + 
		3.102366872257998 * (-19.35065798136946 + $x2))) - 0.5193216914508474 / 
		(1 + pow($E, 0.9962018993651756 - 9.375719737359825 *(-47.141879554771464 + $x1) + 
		3.281833200178861 * (-19.35065798136946 + $x2))) + 6.340688257879171e-6 / 
		(1 + pow($E, -0.2613115071269013 - 5.858049086014856 * (-47.141879554771464 + $x1) + 
		4.030770398946539 * (-19.35065798136946 + $x2))) + 1.1811834423859869e-6 / 
		(1 + pow($E, 5.969800408705918 - 1.1309832302481335 * (-47.141879554771464 + $x1) + 
		6.433287076033156 * (-19.35065798136946 + $x2))) - 1.767449439846206e-6 / 
		(1 + pow($E, 10.926069992208152 - 6.9999931821553325 * (-47.141879554771464 + $x1) + 
		6.445809619835545 * (-19.35065798136946 + $x2))))}]
	return $w
}

#
# transformation from WGS84 to EOV
# Northing (X) coordinate
# @param x1 longitude
# @param x2 latitude
# @return EOV x coordinate
proc eovx {x1 x2} {
	global E
	set w [expr {201336.0152722373 + 72235.8987569045 *     (20.1186138437484 + 0.000029855074419351342 / 
		(1 + pow($E, -8.093975491912275 + 0.327576054051514 * (-47.1448305621818 + $x1) - 
		3.1593195853450258 * (-19.358580801100622 + $x2))) - 0.00007296810481608114 / 
		(1 + pow($E, -2.591497317676374 + 2.6652769000723926 * (-47.1448305621818 + $x1) - 
		1.5135760853564697 * (-19.358580801100622 + $x2))) - 0.0016778017090640456 / 
		(1 + pow($E, -1.2984502520252506 - 2.041469023908986 * (-47.1448305621818 + $x1) - 
		1.3589732133082133 * (-19.358580801100622 + $x2))) - 0.04866543694596775 / 
		(1 + pow($E, -4.921781058980777 - 1.4676530445138478 * (-47.1448305621818 + $x1) - 
		1.267354644251645 * (-19.358580801100622 + $x2))) - 0.20340473529187225 / 
		(1 + pow($E, -2.3425919461205207 - 0.9545949450282186 *(-47.1448305621818 + $x1) - 
		0.7737497322830763 * (-19.358580801100622 + $x2))) - 0.005581805957916701 / 
		(1 + pow($E, -1.018624252162087 + 0.7923164653974588 * (-47.1448305621818 + $x1) - 
		0.6411091618454516 * (-19.358580801100622 + $x2))) - 0.00005396299517184551 / 
		(1 + pow($E, -6.848977944245384 + 6.359967080121827 * (-47.1448305621818 + $x1) - 
		0.33561805957215707 * (-19.358580801100622 + $x2))) - 3.551074894163087 / 
		(1 + pow($E, -0.2911346622559973 + 0.0033956638013658332 * (-47.1448305621818 + $x1) - 
		0.18059738743324705 * (-19.358580801100622 + $x2))) + 1.916852929311139 / 
		(1 + pow($E, 0.7343353616141658 - 0.6863964131301489 * (-47.1448305621818 + $x1) - 
		0.06880943439866727 * (-19.358580801100622 + $x2))) - 18.16654559160064 / 
		(1 + pow($E, -2.3299597896288504 + 0.3487556422231517 * (-47.1448305621818 + $x1) + 
		0.04248396702560472 * (-19.358580801100622 + $x2))) - 10.992388253521458 / 
		(1 + pow($E, 1.496250662973914 + 0.45949154329414627 * (-47.1448305621818 + $x1) + 
		0.06580492125109642 * (-19.358580801100622 + $x2))) - 0.08397914802031649 /
		(1 + pow($E, 0.8290744236677494 + 1.3810383316783807 * (-47.1448305621818 + $x1) + 
		0.18099820269205194 * (-19.358580801100622 + $x2))) + 0.021990933258028873 / 
		(1 + pow($E, 1.2063860521552856 + 2.2774047879644823 * (-47.1448305621818 + $x1) + 
		0.45242732561835197 * (-19.358580801100622 + $x2))) + 0.22473968007020356 / 
		(1 + pow($E, 3.1474957606604113 - 0.5822372361404388 * (-47.1448305621818 + $x1) + 
		0.4651700162891856 * (-19.358580801100622 + $x2))) - 0.013289152923196866 / 
		(1 + pow($E, 1.2807604124410101 + 2.4302680465224897 * (-47.1448305621818 + $x1) + 
		0.508462523861001 * (-19.358580801100622 + $x2))) - 0.12194396499747162 / 
		(1 + pow($E, 4.517042194155517 + 1.504132060787895 * (-47.1448305621818 + $x1) + 
		0.5401917766381635 * (-19.358580801100622 + $x2))) + 786.912116171395 / 
		(1 + pow($E, -0.3522079214876231 + 0.7079683340400437 *(-47.1448305621818 + $x1) + 
		0.5706904227414545 * (-19.358580801100622 + $x2))) - 786.7226656910241 / 
		(1 + pow($E, -0.35228596559127906 + 0.707981206103964 * (-47.1448305621818 + $x1) + 
		0.5707140254230285 * (-19.358580801100622 + $x2))) - 5.888980143884256 / 
		(1 + pow($E, 7.246617248626787 + 1.6053732013316222 * (-47.1448305621818 + $x1) + 
		1.086900177303396 * (-19.358580801100622 + $x2))) + 0.0012905390140480447 / 
		(1 + pow($E, -3.6378646499306684 + 0.04033140971256738 * (-47.1448305621818 + $x1) + 
		1.0883096592271586 * (-19.358580801100622 + $x2))) + 5.564674781622208 / 
		(1 + pow($E, 7.206508661467759 + 1.6142958910184664 * (-47.1448305621818 + $x1) + 
		1.1141423320227177 * (-19.358580801100622 + $x2))) - 0.0005815008547031666 / 
		(1 + pow($E, -5.069993798348717 + 2.7056631633829014 * (-47.1448305621818 + $x1) + 
		1.1992122995659569 * (-19.358580801100622 + $x2))) + 0.0003032431252421647 / 
		(1 + pow($E, -5.913542051731756 + 3.621857242713389 * (-47.1448305621818 + $x1) + 
		1.2786984470608989 * (-19.358580801100622 + $x2))) - 0.00017469105467762098 / 
		(1 + pow($E, -2.5690193236618737 - 1.6945758475700705 * (-47.1448305621818 + $x1) + 
		1.285776906906776 * (-19.358580801100622 + $x2))) - 0.000013783408761789675 / 
		(1 + pow($E, -4.0362520200979315 - 3.9067677234746263 * (-47.1448305621818 + $x1) + 
		1.5773327839985254 * (-19.358580801100622 + $x2))) - 0.0003231974637568616 / 
		(1 + pow($E, 4.566385950178921 + 2.9380005052223463 * (-47.1448305621818 + $x1) + 
		1.6045480112938426 * (-19.358580801100622 + $x2))) + 0.00013639180019605753 / 
		(1 + pow($E, -0.08886694537907301 + 3.377991626316386 * (-47.1448305621818 + $x1) + 
		2.0823620747289247 * (-19.358580801100622 + $x2))) + 0.0000487973350046425 / 
		(1 + pow($E, -2.2512314909430096 + 3.903851866767497 * (-47.1448305621818 + $x1) + 
		2.3640576678801346 * (-19.358580801100622 + $x2))) + 6.983901065590293e-6 / 
		(1 + pow($E, 1.3813471690921484 - 5.47363016625317 * (-47.1448305621818 + $x1) + 
		3.07391184260703 * (-19.358580801100622 + $x2))) + 7.188435656522073e-6 / 
		(1 + pow($E,-3.4811825670287613 - 1.0228321698342047 * (-47.1448305621818 + $x1) + 
		3.5461659364244045 *(-19.358580801100622 + $x2))))}]
	return $w
}


#
# transformation from EOV to WGS84
# latitude
# @param x1 EOV y coordinate
# @param x2 EOV x coordinate
# @return latitude
proc wgsfi {x1 x2} {
	global E
	set w [expr {47.1448305621818 + 0.6453462742167522 * (280.46608948987097 + 7.886727945198825e-6 / 
		(1 + pow($E, 0.43088910069289205 + 1.7477784362661703e-6 * (-672997.087159029 + $x1) - 
		0.00008624419159004427 * (-201336.0152722373 + $x2))) - 0.000023461499358947202 / 
		(1 + pow($E, 1.195239929047086 - 0.000016606307916253764 * (-672997.087159029 + $x1) - 
		0.00004376802504964629 * (-201336.0152722373 + $x2))) + 0.00029632096445713073 / 
		(1 + pow($E, 5.321074852840661 - 6.945223586481736e-6 *(-672997.087159029 + $x1) - 
		0.00003644090126524243 * (-201336.0152722373 + $x2))) + 0.0087952850318137 / 
		(1 + pow($E, 3.845355646869166 + 0.000019089618010270258 * (-672997.087159029 + $x1) - 
		0.000035929980986618083 * (-201336.0152722373 + $x2))) + 0.1350997530434812 / 
		(1 + pow($E, 2.7664128611618413 + 0.000018001655600824225 * (-672997.087159029 + $x1) - 
		0.00003525703792529229 * (-201336.0152722373 + $x2))) + 0.0005756147825392633 / 
		(1 + pow($E, 3.092394876682549 - 2.7899412830217303e-6 * (-672997.087159029 + $x1) - 
		0.000034766621164612685 * (-201336.0152722373 + $x2))) + 0.000020598065653489954 / 
		(1 + pow($E, 6.456760468297512 - 0.00002927928601836315 * (-672997.087159029 + $x1) - 
		0.00003306372245709705 * (-201336.0152722373 + $x2))) - 270.51037328212664 / 
		(1 + pow($E, 2.2526633245219876 + 0.00001672223927604134 * (-672997.087159029 + $x1) - 
		0.00003278165887950201 * (-201336.0152722373 + $x2))) - 0.0036302662138444105 / 
		(1 + pow($E, -3.248903144897968 - 0.000011300446502122065 * (-672997.087159029 + $x1) - 
		0.000022764640287316383 * (-201336.0152722373 + $x2))) - 0.00006168449435453348 / 
		(1 + pow($E, -2.548992165410912 - 0.000020255274986933403 * (-672997.087159029 + $x1) - 
		0.000022208340178782616 * (-201336.0152722373 + $x2))) + 0.009143633548514905 / 
		(1 + pow($E, -2.811735845804687 - 9.063592621645829e-6 * (-672997.087159029 + $x1) - 
		0.0000193225950669259 * (-201336.0152722373 + $x2))) - 0.00018408339954775673 / 
		(1 + pow($E, 2.3790268786282938 + 0.000025262814742560466 * (-672997.087159029 + $x1) - 
		0.00001869944319912385 * (-201336.0152722373 + $x2))) + 0.13464206608466678 / 
		(1 + pow($E, -0.29024192705092944 + 2.8522169478614636e-6 * (-672997.087159029 + $x1) - 
		0.00001092776805456014 * (-201336.0152722373 + $x2))) + 0.06787517275700519 / 
		(1 + pow($E, -0.15605431142439016 - 2.6535135656094775e-6 * (-672997.087159029 + $x1) - 
		9.900081593438757e-6 * (-201336.0152722373 + $x2))) + 0.7477764113402581 / 
		(1 + pow($E, -1.460645787157641 + 2.982347015293836e-6 * (-672997.087159029 + $x1) - 
		7.155432769651022e-6 * (-201336.0152722373 + $x2))) - 0.7641019669852045 / 
		(1 + pow($E, 3.4398988678672473 + 6.729444982573373e-6 * (-672997.087159029 + $x1) - 
		1.0617216099474333e-6 * (-201336.0152722373 + $x2))) + 1.3439062701633362 / 
		(1 + pow($E,-0.8666305623605491 - 3.6926799431777393e-6 * (-672997.087159029 + $x1) + 
		2.618255813491458e-7 * (-201336.0152722373 + $x2))) - 0.000871055137271807 / 
		(1 + pow($E, -5.087566849227811 - 0.00002108579822398014 * (-672997.087159029 + $x1) + 
		8.077448347478437e-7 * (-201336.0152722373 + $x2))) - 3.194245528706434 / 
		(1 + pow($E, -1.001929300938616 + 1.528960976503242e-6 * (-672997.087159029 + $x1) + 
		2.4384825340318095e-6 * (-201336.0152722373 + $x2))) - 10.819428554936025 / 
		(1 + pow($E, -1.2454018294156268 - 8.7754571526761e-7 * (-672997.087159029 + $x1) + 
		3.871027767852754e-6 * (-201336.0152722373 + $x2))) - 7.075914602410781 / 
		(1 + pow($E, 4.804063672416174 - 3.344850100867741e-6 * (-672997.087159029 + $x1) + 
		4.190943907657275e-6 * (-201336.0152722373 + $x2))) - 7.5802216810759555 / 
		(1 + pow($E, 1.9699884424765317 + 4.3444425531227666e-8 * (-672997.087159029 + $x1) + 
		4.4440737390487265e-6 * (-201336.0152722373 + $x2))) - 0.000010692144540193364 / 
		(1 + pow($E, 0.606049914123596 - 0.000037009457200764726 * (-672997.087159029 + $x1) + 
		7.5801237945104654e-6 * (-201336.0152722373 + $x2))) - 0.0001385321401668817 / 
		(1 + pow($E,-2.262859287008408 - 0.00002553476924044911 * (-672997.087159029 + $x1) + 
		0.000017499754761947728 * (-201336.0152722373 + $x2))) - 0.08075798493702666 / 
		(1 + pow($E, -1.8906687392307646 - 0.000012585425781685353 * (-672997.087159029 + $x1) + 
		0.000025758286072797215 * (-201336.0152722373 + $x2))) - 270.2928478443408 / 
		(1 + pow($E, -2.252512398926454 - 0.000016722964267440533 * (-672997.087159029 + $x1) +
		0.00003278293509038775 * (-201336.0152722373 + $x2))) - 0.016573034666417387 / 
		(1 + pow($E, -1.1609988232405342 - 0.00002348099067798666 * (-672997.087159029 + $x1) + 
		0.00003730446705790297 * (-201336.0152722373 + $x2))) + 0.015151615286564685 / 
		(1 + pow($E, -1.1673346213570213 - 0.000023759010268590778 * (-672997.087159029 + $x1) + 
		0.000037525265582526807 * (-201336.0152722373 + $x2))) - 0.00018248225417394912 / 
		(1 + pow($E, -1.70406415732602 + 1.4489438738100763e-6 * (-672997.087159029 + $x1) + 
		0.00004216242190491755 * (-201336.0152722373 + $x2))) - 0.00002510208689497676 / 
		(1 + pow($E, 5.655502870411171 - 4.745339173025691e-6 * (-672997.087159029 + $x1) + 
		0.00005994349703488143 * (-201336.0152722373 + $x2))))}]
		return $w
}

#
# transformation from EOV to WGS84
# longitude
# @param x1 EOV y coordinate
# @param x2 EOV x coordinate
# @return longitude
proc wgslambda {x1 x2} {
	global E
	set w [expr {19.358580801100622 + 1.58217721758051 * (-4.265599951954124 + 8.095958199509277e-6 / 
		(1 + pow($E, -5.680442392103712 + 4.014815060350221e-6 * (-672997.087159029 + $x1) - 
		0.00007223572841013194 * (-201336.0152722373 + $x2))) - 4.180652389420646e-6/
		(1 + pow($E, 2.0059344524844533 + 0.00007129806107500366 * (-672997.087159029 + $x1) - 
		0.00005732755846085342 * (-201336.0152722373 + $x2))) + 0.0016404146419169159/
		(1 + pow($E, 5.363810837293004 + 0.000010129847357970255 * (-672997.087159029 + $x1) - 
		0.00004905136754851379 *(-201336.0152722373 + $x2))) - 0.000052008995858358655/
		(1 + pow($E, -2.2174100651688957 + 0.00001398139016485919 *(-672997.087159029 + $x1) - 
		0.000033973347354028815 *(-201336.0152722373 + $x2))) + 0.00008837269676673746/
		(1 + pow($E, 3.3797868221671012 + 0.000028426261561132554 *(-672997.087159029 + $x1) - 
		0.00002470894553731893 *(-201336.0152722373 + $x2))) + 0.001901294357141489/
		(1 + pow($E, -5.431496062277494 - 0.000026901156783704673 *(-672997.087159029 + $x1) - 
		0.000017148041736945787 *(-201336.0152722373 + $x2))) - 0.00013167379053669577/
		(1 + pow($E, 2.07425372229156 - 0.000022015134083724753 *(-672997.087159029 + $x1) - 
		7.675258554042417e-6 *(-201336.0152722373 + $x2))) + 3.483645775824239e-6/
		(1 + pow($E, 0.7107716893108816 - 0.00007802822183713364 *(-672997.087159029 + $x1) - 
		4.962821168458543e-6 *(-201336.0152722373 + $x2))) - 0.0014027812664886793/
		(1 + pow($E, -2.102495019508211 - 0.000017733582929873295 *(-672997.087159029 + $x1) - 
		4.3413925673664666e-6 *(-201336.0152722373 + $x2))) - 7834.85898954901/
		(1 + pow($E, 2.2073005120480844 - 1.8923820935247924e-6 *(-672997.087159029 + $x1) - 
		2.1306950258608695e-6 *(-201336.0152722373 + $x2))) + 7834.756192882274/
		(1 + pow($E, 2.2085782036664177 - 1.8957580947580068e-6 *(-672997.087159029 + $x1) - 
		2.13053791657765e-6 *(-201336.0152722373 + $x2))) + 4.008320371869083/
		(1 + pow($E, 0.6064322724057087 - 3.830897383393015e-6 *(-672997.087159029 + $x1) - 
		1.8201497934477872e-6 *(-201336.0152722373 + $x2))) + 4.580687781428328/
		(1 + pow($E, -1.1717331851056438 - 4.222532519856323e-6 *(-672997.087159029 + $x1) - 
		1.2374471314504404e-6 *(-201336.0152722373 + $x2))) - 0.001513866629536354/
		(1 + pow($E, -0.13771191906946204 - 0.000015252828275866858 *(-672997.087159029 + $x1) + 
		3.990479288356099e-7 *(-201336.0152722373 + $x2))) - 2.252358957086597/
		(1 + pow($E, 3.873974606465716 + 6.65046935867269e-6 *(-672997.087159029 + $x1) + 
		8.580807143138684e-7 *(-201336.0152722373 + $x2))) - 0.002635764549736631/
		(1 + pow($E, -4.5930699198972595 + 0.000017103309390171037 *(-672997.087159029 + $x1) + 
		4.61839048237452e-6 *(-201336.0152722373 + $x2))) + 0.8874909767829579/
		(1 + pow($E, 0.7000356036235991 - 2.2625689696651706e-7 *(-672997.087159029 + $x1) + 
		5.091194563382053e-6 *(-201336.0152722373 + $x2))) + 0.004935603551309162/
		(1 + pow($E, -0.6425930780535968 - 8.749598985267157e-6 *(-672997.087159029 + $x1) + 
		0.000010773226784863697 *(-201336.0152722373 + $x2))) + 0.002859786120419025/
		(1 + pow($E, 5.087439691245142 + 0.000024937490622539254 *(-672997.087159029 + $x1) + 
		0.000015417155811501537 *(-201336.0152722373 + $x2))) + 0.025109573293481884/
		(1 + pow($E, 2.8691800892681707 - 2.295877953422129e-6 *(-672997.087159029 + $x1) + 
		0.0000185651747614609 *(-201336.0152722373 + $x2))) + 0.000746905487950958/
		(1 + pow($E, 2.9763796416517856 - 0.00002912867845244321 *(-672997.087159029 + $x1) + 
		0.00002720861401857074 *(-201336.0152722373 + $x2))) + 0.00021122842889656645/
		(1 + pow($E, 6.0469238078240535 - 0.000033298625573293395 *(-672997.087159029 + $x1) + 
		0.000029280442229884525 *(-201336.0152722373 + $x2))) - 0.000017582926922155112/
		(1 + pow($E, -6.064752713196278 + 0.000023695236118288498 *(-672997.087159029 + $x1) + 
		0.00003202393115398116 *(-201336.0152722373 + $x2))) - 0.00023662913637931266/
		(1 + pow($E, 3.854831945183119 - 0.00003789374179343954 *(-672997.087159029 + $x1) + 
		0.000035387753524373776 *(-201336.0152722373 + $x2))) + 0.00002609387886903073/
		(1 + pow($E, 0.699650179722949 - 0.000021188965213485975 *(-672997.087159029 + $x1) + 
		0.000035449889507588604 *(-201336.0152722373 + $x2))) + 0.0134825188698488/
		(1 + pow($E, 6.92614258115802 - 4.075298746713109e-6 *(-672997.087159029 + $x1) + 
		0.00003590849101717477 *(-201336.0152722373 + $x2))) + 0.00006684864637617804/
		(1 + pow($E, 0.6523946383431992 - 0.00004007672383430463 *(-672997.087159029 + $x1) + 
		0.00003625769581748543 *(-201336.0152722373 + $x2))) + 0.0019550459602656694/
		(1 + pow($E, -4.971049595752441 - 9.443830112141726e-6 *(-672997.087159029 + $x1) + 
		0.00004485916289419817 *(-201336.0152722373 + $x2))) + 2.964071498414781e-6/
		(1 + pow($E, 0.18602229250921642 + 4.75903515385659e-6 *(-672997.087159029 + $x1) + 
		0.00005245088267895793 *(-201336.0152722373 + $x2))) + 0.00005023045219551206/
		(1 + pow($E, -8.833391044296283 - 0.000016967497443386767 *(-672997.087159029 + $x1) + 
		0.00008639331686519943 *(-201336.0152722373 + $x2))))}]
	return $w
}
